package github.kawaiior.botapiserver.common;

import cn.hutool.json.JSONUtil;

public class ActionResponse {
    private final int code;
    private final String message;

    public static final ActionResponse DEFAULT_SUCCESS_RESPONSE = new ActionResponse(1, "请求成功");
    public static final ActionResponse DEFAULT_FAIL_RESPONSE = new ActionResponse(0, "请求失败");

    public ActionResponse(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    @Override
    public String toString(){
        return JSONUtil.toJsonStr(this);
    }
}
